#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcssdataurlprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
+#include "gtk/css/gtkcssserializerprivate.h"
#ifdef CAIRO_HAS_SCRIPT_SURFACE
#include <cairo-script.h>
gsize n_options,
gpointer user_data);
-
-void _gtk_css_print_string (GString *str,
- const char *string);
G_END_DECLS
#endif /* __GTK_CSS_PARSER_H__ */
--- /dev/null
+/* GTK - The GIMP Toolkit
+ * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "gtkcssserializerprivate.h"
+
+/* Escape a string so that it can be parsed
+ * as a css string again.
+ */
+void
+_gtk_css_print_string (GString *str,
+ const char *string)
+{
+ gsize len;
+
+ g_return_if_fail (str != NULL);
+ g_return_if_fail (string != NULL);
+
+ g_string_append_c (str, '"');
+
+ do {
+ len = strcspn (string, "\\\"\n\r\f");
+ g_string_append_len (str, string, len);
+ string += len;
+ switch (*string)
+ {
+ case '\0':
+ goto out;
+ case '\n':
+ g_string_append (str, "\\A ");
+ break;
+ case '\r':
+ g_string_append (str, "\\D ");
+ break;
+ case '\f':
+ g_string_append (str, "\\C ");
+ break;
+ case '\"':
+ g_string_append (str, "\\\"");
+ break;
+ case '\\':
+ g_string_append (str, "\\\\");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ string++;
+ } while (*string);
+
+out:
+ g_string_append_c (str, '"');
+}
--- /dev/null
+/*
+ * Copyright © 2020 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Matthias Clasen <mclasen@redhat.com>
+ */
+
+
+#ifndef __GTK_CSS_SERIALIZER_H__
+#define __GTK_CSS_SERIALIZER_H__
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void _gtk_css_print_string (GString *str,
+ const char *string);
+
+G_END_DECLS
+
+#endif /* __GTK_CSS_SERIALIZER_H__ */
'gtkcssdataurl.c',
'gtkcssparser.c',
'gtkcsstokenizer.c',
+ 'gtkcssserializer.c',
])
gtk_css_public_headers = files([
#ifndef __GTK_CSS_ARRAY_VALUE_PRIVATE_H__
#define __GTK_CSS_ARRAY_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtktypes.h"
#ifndef __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__
#define __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssimageprivate.h"
#include "gtkcssvalueprivate.h"
#ifndef __GTK_CSS_BORDER_VALUE_PRIVATE_H__
#define __GTK_CSS_BORDER_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssvalueprivate.h"
#ifndef __GTK_CSS_COLOR_VALUE_PRIVATE_H__
#define __GTK_CSS_COLOR_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#ifndef __GTK_CSS_CORNER_VALUE_PRIVATE_H__
#define __GTK_CSS_CORNER_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#ifndef __GTK_CSS_EASE_VALUE_PRIVATE_H__
#define __GTK_CSS_EASE_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#define __GTK_CSS_ENUM_VALUE_PRIVATE_H__
#include "gtkenums.h"
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"
#ifndef __GTK_CSS_FILTER_VALUE_PRIVATE_H__
#define __GTK_CSS_FILTER_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#include "config.h"
#include "gtkcsstypesprivate.h"
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssfontfeaturesvalueprivate.h"
#ifndef __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#include "config.h"
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssfontvariationsvalueprivate.h"
#ifndef __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#include <math.h>
+#include "gtk/css/gtkcssserializerprivate.h"
#include "gtksettingsprivate.h"
#include "gtksnapshot.h"
#include "gtkstyleproviderprivate.h"
#include <cairo.h>
#include <glib-object.h>
-#include "gtk/gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcsstypesprivate.h"
#include "gtk/gtksnapshot.h"
#include "gtk/gtkstyleprovider.h"
#ifndef __GTK_CSS_KEYFRAMES_PRIVATE_H__
#define __GTK_CSS_KEYFRAMES_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtktypes.h"
#ifndef __GTK_CSS_NUMBER_VALUE_PRIVATE_H__
#define __GTK_CSS_NUMBER_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"
#ifndef __GTK_CSS_PALETTE_VALUE_PRIVATE_H__
#define __GTK_CSS_PALETTE_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
+++ /dev/null
-/* GTK - The GIMP Toolkit
- * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "config.h"
-
-#include "gtkcssparserprivate.h"
-
-void
-_gtk_css_print_string (GString *str,
- const char *string)
-{
- gsize len;
-
- g_return_if_fail (str != NULL);
- g_return_if_fail (string != NULL);
-
- g_string_append_c (str, '"');
-
- do {
- len = strcspn (string, "\\\"\n\r\f");
- g_string_append_len (str, string, len);
- string += len;
- switch (*string)
- {
- case '\0':
- goto out;
- case '\n':
- g_string_append (str, "\\A ");
- break;
- case '\r':
- g_string_append (str, "\\D ");
- break;
- case '\f':
- g_string_append (str, "\\C ");
- break;
- case '\"':
- g_string_append (str, "\\\"");
- break;
- case '\\':
- g_string_append (str, "\\\\");
- break;
- default:
- g_assert_not_reached ();
- break;
- }
- string++;
- } while (*string);
-
-out:
- g_string_append_c (str, '"');
-}
-
+++ /dev/null
-/* GTK - The GIMP Toolkit
- * Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GTK_CSS_PARSER_PRIVATE_H__
-#define __GTK_CSS_PARSER_PRIVATE_H__
-
-#include <gtk/gtkcssprovider.h>
-
-#include <gtk/css/gtkcss.h>
-#include "gtk/css/gtkcsstokenizerprivate.h"
-#include "gtk/css/gtkcssparserprivate.h"
-
-#endif /* __GTK_CSS_PARSER_PRIVATE_H__ */
#ifndef __GTK_CSS_POSITION_VALUE_PRIVATE_H__
#define __GTK_CSS_POSITION_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#include "gtkcssproviderprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkbitmaskprivate.h"
#include "gtkcssarrayvalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcsskeyframesprivate.h"
-#include "gtkcssparserprivate.h"
#include "gtkcssselectorprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtksettingsprivate.h"
#ifndef __GTK_CSS_REPEAT_VALUE_PRIVATE_H__
#define __GTK_CSS_REPEAT_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#ifndef __GTK_CSS_SELECTOR_PRIVATE_H__
#define __GTK_CSS_SELECTOR_PRIVATE_H__
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcountingbloomfilterprivate.h"
#include "gtk/gtkcsstypesprivate.h"
-#include "gtk/gtkcssparserprivate.h"
#define GDK_ARRAY_ELEMENT_TYPE gpointer
#define GDK_ARRAY_TYPE_NAME GtkCssSelectorMatches
#include <cairo.h>
#include <pango/pango.h>
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkborder.h"
#include "gtktypes.h"
-#include "gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkroundedboxprivate.h"
#include "gtksnapshot.h"
#include <glib-object.h>
-#include "gtk/gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcssstylepropertyprivate.h"
#include "gtk/gtkstylepropertyprivate.h"
#include "config.h"
#include "gtkcssstringvalueprivate.h"
+#include "gtk/css/gtkcssserializerprivate.h"
#include <string.h>
#ifndef __GTK_CSS_STRING_VALUE_PRIVATE_H__
#define __GTK_CSS_STRING_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <math.h>
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkintl.h"
#ifndef __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__
#define __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
#include "gtkstylepropertyprivate.h"
#include "gtkcssprovider.h"
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcsstypesprivate.h"
#ifndef __GTK_STYLEPROPERTY_PRIVATE_H__
#define __GTK_STYLEPROPERTY_PRIVATE_H__
-#include "gtkcssparserprivate.h"
+#include <gtk/css/gtkcss.h>
+#include "gtk/css/gtkcsstokenizerprivate.h"
+#include "gtk/css/gtkcssparserprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkcssvalueprivate.h"
'gtkcssnodestylecache.c',
'gtkcssnumbervalue.c',
'gtkcsspalettevalue.c',
- 'gtkcssparser.c',
'gtkcsspositionvalue.c',
'gtkcssrepeatvalue.c',
'gtkcssselector.c',